As shown in FIG. 1, a conventional computer includes, among other things, a Central Processing Unit (CPU) 101, Input/Output (I/O) bus 103 and I/O devices 105. The I/O bus 103 allows information to flow between the I/O devices 105, the CPU 101 and Random Access Memory (RAM). Examples of buses are ISA (Industry Standard Architecture), EISA (Extended Industry Standard Architecture), PCI (Peripheral Component Interconnect), and MCA (Micro Channel Architecture).
Typical I/O devices include key boards, printers, network devices, game devices, etc. The I/O bus, in turn, is connected to each I/O device by means of a hierarchy of hardware components including: I/O ports 107, interfaces, and device controllers 109. Each device connected to the I/O bus has its own set of I/O addresses. In operation, the CPU selects an I/O port and uses the I/O bus to transfer data between a CPU register and the port.
In particular, in an exemplary arrangement as shown in FIG. 2, the CPU 101 writes into a control register 201 the commands to be sent to the I/O device and reads from a status register 203 a value that represents the internal state of the I/O device. The CPU 101 also fetches data from the I/O device by reading bytes from an input register 205 and pushes data to the I/O device by writing bytes into an output register 207.
An I/O interface 209 is a hardware circuit and/or software operating between a group of I/O ports and the corresponding device controller. It acts as an interpreter that translates the values in the I/O ports into commands and data for the device. In the opposite direction, it detects changes in the device state and correspondingly updates the I/O port that plays the role of status register. Examples of common interfaces are: keyboard interface, disk interface, bus mouse interface, network interface, parallel port, serial port, Universal Serial Bus (USB), PCMCIA interface, PCI interface, SCSI interface, etc.
The system level operations of the above-described components are performed by an operating system that includes a kernel. The kernel provides basic services for the operating system. Typically, the kernel (or any comparable center of an operating system) includes an interrupt handler that handles all requests or completed I/O operations that compete for the kernel's services, a scheduler that determines which programs share the kernel's processing time in what order, and a supervisor that actually gives use of the computer to each process when it is scheduled.
In conventional operating systems, the kernel is required to handle I/O device errors. Many error handling routines and the calls made by those routines are complex and extensive. In order to handle individual errors for all I/O devices, the kernel itself becomes complex. This complexity tends to lengthen the development time of the kernel. It also makes the debugging and maintenance of the kernel an arcane and difficult process.